<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns:th="http://www.thymeleaf.org">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

		<title>搜索页面</title>

		<link th:href="@{/static/assets/css/amazeui.css}" rel="stylesheet" type="text/css" />
		<link th:href="@{/static/assets/css/admin.css}" rel="stylesheet" type="text/css" />

		<link th:href="@{/static/basic/css/demo.css}" rel="stylesheet" type="text/css" />

		<link th:href="@{/static/css2/seastyle.css}" rel="stylesheet" type="text/css" />

		<script type="text/javascript" th:src="@{/static/basic/js/jquery-1.7.min.js}"></script>
		<script type="text/javascript" th:src="@{/static/js/script.js}"></script>
<!--layui样式-->
		<link rel="stylesheet" type="text/css" th:href="@{/static/lib/layui-v2.6.3/css/layui.css}"/>
		<script type="text/javascript" th:src="@{/static/lib/jquery-3.4.1/jquery-3.4.1.min.js}"></script>
		<script type="text/javascript" th:src="@{/static/lib/layui-v2.6.3/layui.js}"></script>
	</head>

	<body>

	<div class="am-container header">
		<ul class="message-l">
			<div class="topMessage">
				<div class="menu-hd">
					<a href="/login1/login" target="_top" class="h">亲，请登录</a>
					<a href="/login1/enroll" target="_top">免费注册</a>
				</div>
			</div>
		</ul>
		<ul class="message-r">
			<div class="topMessage home">
				<div class="menu-hd"><a href="/user/main" target="_top" class="h">省多多商城</a></div>
			</div>
			<div th:onclick="myAccount([[${userPhone}]])" class="topMessage my-shangcheng">
				<div class="menu-hd MyShangcheng"><a target="_top"><i class="am-icon-user am-icon-fw"></i>[[${userPhone}]]</a></div>
			</div>
			<div class="topMessage mini-cart">
				<div class="menu-hd"><a id="mc-menu-hd" href="/cart/list" target="_top"><i class="am-icon-shopping-cart  am-icon-fw"></i><span>购物车</span><strong id="J_MiniCartNum" class="h">0</strong></a></div>
			</div>
			<div class="topMessage favorite">
				<div class="menu-hd"><a href="/myOrder/list" target="_top"><i class="am-icon-heart am-icon-fw"></i><span>我的订单</span></a></div>
			</div>
		</ul>
	</div>
	<!--悬浮搜索框-->
	<div class="nav white">
		<div class="logo"><img th:src="@{/static/images2/logo.png}" /></div>
		<div class="logoBig">
			<li><img th:src="@{/static/images2/logobig.png}"/></li>
		</div>
		<div class="search-bar pr">
			<a name="index_none_header_sysc" href="#"></a>
			<form action="search.html">
				<input id="searchInput" name="index_none_header_sysc" type="text" placeholder="搜索" autocomplete="off">
				<input id="ai-topsearch" class="submit am-btn" value="搜索" index="1" type="submit">
			</form>
		</div>
	</div>
	<div class="clear"></div>

           <div class="search">
					<div class="am-g am-g-fixed">
							<div class="search-content">

								<ul class="am-avg-sm-2 am-avg-md-3 am-avg-lg-4 boxes">
									<li th:each="goods:${pageInfo.list}">
										<div class="i-pic limit" th:onclick="detail([[${goods.id}]])">
											<img th:src="'http://localhost:8887/'+ ${goods.imgUrl}" />
											<p class="title fl" th:text="${goods.goodsName}"></p>
											<p class="price fl">
												<b>¥</b>
												<strong>[[${goods.goodsPrice}]]</strong>
											</p>
											<p class="number fl">
												库存<span>[[${goods.goodsCount}]]</span>
											</p>
										</div>
									</li>
								</ul>
							</div>
					</div>
				</div>

	<div style="text-align:center;">
		<button class="layui-btn" onclick="jump(1)">首页</button>
		<button class="layui-btn" th:onclick="jump([[${pageInfo.pageNum-1}]])">上一页</button>
		<span th:text="${pageInfo.pageNum} + '/' + ${pageInfo.pages} + '页'"></span>
		<button class="layui-btn" th:onclick="jump([[${pageInfo.pageNum+1}]])">下一页</button>
		<button class="layui-btn" th:onclick="jump([[${pageInfo.pages}]])">尾页</button>
	</div>
	<input type="hidden" id="superiorId" th:value="${superiorId}">
	</body>
	<script>
    <!--点击b2商城跳转主页-->
    function jump(pageNum) {
	    var suId =$("#superiorId").val();
		var url = "query?superiorId=" + suId + "&pageNum=" + pageNum;
		window.location.href = url;
		}
	function detail(id){
        window.location.href = "/sg/detail?id="+id;
    }
</script>

</html>